package lab02.test21;

/**
 * Created by dell on 2017/10/26.
 */
public class Test {
    public static int str(String str,char c)  {
        // 	统计一个字符串中给定字符出现的频率
        int count=0;
        for(int i=0;i<str.length();i++){
            if(str.charAt(i)==c){
                count++;
            }
        }
        return count;
    }
    public static void main(String[] args) {
        System.out.println(new Test().str("echo,i love you",'o'));
    }
}
